Skip to content

Add an endpoint for signed-in user data and minimize the JWT payload#7

Merged
hussein-m-kandil merged 2 commits intomainfrom
dev
May 20, 2025
Merged

Add an endpoint for signed-in user data and minimize the JWT payload#7
hussein-m-kandil merged 2 commits intomainfrom
dev

Conversation

@hussein-m-kandil
Copy link
Copy Markdown
Owner

This pull request introduces a dedicated endpoint to fetch the authenticated user's data. It also updates the authentication logic to reduce the JWT payload to essential fields only, without any personally identifiable information (PII). On verification, the full user data is queried from the database instead of being embedded in the token.

What’s New

  • ➕ Added GET /api/v1/auth/me to return the authenticated user's data.
  • ⚙️ Reduced the JWT payload to include only the user ID and their role.
  • 🗃️ Updated the token verification logic to fetch the full user record from the DB.

@hussein-m-kandil hussein-m-kandil merged commit 0d4fbf1 into main May 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant